<?php

namespace App\Admin\Controllers;

use App\Models\Test;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Show;

class TestsController extends AdminController
{
    /**
     * Title for current resource.
     *
     * @var string
     */
    protected $title = 'Test';

    /**
     * Make a grid builder.
     *
     * @return Grid
     */
    protected function grid()
    {
        $grid = new Grid(new Test());

        $grid->column('id', __('Id'));
        $grid->column('column1', __('Column1'));
        $grid->column('column2', __('Column2'));
        $grid->column('column3', __('Column3'));
        $grid->column('column4', __('Column4'));
        $grid->column('column5', __('Column5'));
        $grid->column('column6', __('Column6'));
        $grid->column('column7', __('Column7'));
        $grid->column('column8', __('Column8'));
        $grid->column('column9', __('Column9'));
        $grid->column('column10', __('Column10'));
        $grid->column('column11', __('Column11'));
        $grid->column('column12', __('Column12'));
        $grid->column('column13', __('Column13'));
        $grid->column('column14', __('Column14'));
        $grid->column('column15', __('Column15'));
        $grid->column('column16', __('Column16'));
        $grid->column('column17', __('Column17'));
        $grid->column('column18', __('Column18'));
        $grid->column('column19', __('Column19'));
        $grid->column('column20', __('Column20'));
        $grid->column('created_at', __('Created at'));
        $grid->column('updated_at', __('Updated at'));

        return $grid;
    }

    /**
     * Make a show builder.
     *
     * @param mixed $id
     * @return Show
     */
    protected function detail($id)
    {
        $show = new Show(Test::findOrFail($id));

        $show->field('id', __('Id'));
        $show->field('column1', __('Column1'));
        $show->field('column2', __('Column2'));
        $show->field('column3', __('Column3'));
        $show->field('column4', __('Column4'));
        $show->field('column5', __('Column5'));
        $show->field('column6', __('Column6'));
        $show->field('column7', __('Column7'));
        $show->field('column8', __('Column8'));
        $show->field('column9', __('Column9'));
        $show->field('column10', __('Column10'));
        $show->field('column11', __('Column11'));
        $show->field('column12', __('Column12'));
        $show->field('column13', __('Column13'));
        $show->field('column14', __('Column14'));
        $show->field('column15', __('Column15'));
        $show->field('column16', __('Column16'));
        $show->field('column17', __('Column17'));
        $show->field('column18', __('Column18'));
        $show->field('column19', __('Column19'));
        $show->field('column20', __('Column20'));
        $show->field('created_at', __('Created at'));
        $show->field('updated_at', __('Updated at'));

        return $show;
    }

    /**
     * Make a form builder.
     *
     * @return Form
     */
    protected function form()
    {
        $form = new Form(new Test());

        $form->textarea('column1', __('Column1'));
        $form->textarea('column2', __('Column2'));
        $form->textarea('column3', __('Column3'));
        $form->textarea('column4', __('Column4'));
        $form->textarea('column5', __('Column5'));
        $form->textarea('column6', __('Column6'));
        $form->textarea('column7', __('Column7'));
        $form->textarea('column8', __('Column8'));
        $form->textarea('column9', __('Column9'));
        $form->textarea('column10', __('Column10'));
        $form->textarea('column11', __('Column11'));
        $form->textarea('column12', __('Column12'));
        $form->textarea('column13', __('Column13'));
        $form->textarea('column14', __('Column14'));
        $form->textarea('column15', __('Column15'));
        $form->textarea('column16', __('Column16'));
        $form->textarea('column17', __('Column17'));
        $form->textarea('column18', __('Column18'));
        $form->textarea('column19', __('Column19'));
        $form->textarea('column20', __('Column20'));

        return $form;
    }
}
